package vip.xiaonuo.smzq.modular.jsc.controller;

import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import vip.xiaonuo.smzq.modular.hisi.entity.vo.Kcdgmtj;
import vip.xiaonuo.smzq.modular.jsc.entity.Kczl;
import vip.xiaonuo.smzq.modular.jsc.entity.Kyq;
import vip.xiaonuo.smzq.modular.jsc.entity.Xxlb;
import vip.xiaonuo.smzq.modular.jsc.entity.Zyyskc;
import vip.xiaonuo.smzq.modular.jsc.entity.vo.*;
import vip.xiaonuo.smzq.modular.jsc.service.IKczlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.common.pojo.CommonResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;


/**
 * 驾驶舱矿产种类统计
 *
 * @author sqq
 * @since 2024-05-13
 */
@Api(tags = "驾驶舱矿产种类统计")
@RestController
@RequestMapping("/jsc/kczl")
@Validated
public class KczlController {

    @Resource
    private IKczlService iKczlService;

    /**
     * 添加驾驶舱矿产种类统计
     */
    @ApiOperation("添加驾驶舱矿产种类统计")
    @PostMapping("/add")
    public CommonResult<String> add(@RequestBody @Valid Kczl kczl) {
        iKczlService.add(kczl);
        return CommonResult.ok();
    }

    /**
     * 删除驾驶舱矿产种类统计
     */
    @ApiOperation("删除驾驶舱矿产种类统计")
    @PostMapping("/delete")
    public CommonResult<String> delete(@ApiParam(name = "pkid", value = "主键") @RequestParam String pkid) {
        iKczlService.removeById(pkid);
        return CommonResult.ok();
    }

    /**
     * 编辑驾驶舱矿产种类统计
     */
    @ApiOperation("编辑驾驶舱矿产种类统计")
    @PostMapping("/edit")
    public CommonResult<String> edit(@RequestBody @Valid Kczl kczl) {
        iKczlService.updateById(kczl);
        return CommonResult.ok();
    }

    /**
     * 驾驶舱矿产种类统计分页查询
     */
    @ApiOperation("驾驶舱矿产种类统计查询")
    @GetMapping("/KczlList")
    public CommonResult<List<Kczl>> KczlList(
            Integer nd, String xzqhdm,Integer kclx
    ) {
        return CommonResult.data(iKczlService.KczlList(nd, xzqhdm,kclx));
    }


    /**
     * 驾驶舱首页查询
     */
    @ApiOperation("驾驶舱首页查询")
    @GetMapping("/getLdjscData")
    public CommonResult<LdjscData> getLdjscData(
            Integer nd
    ) {
        return CommonResult.data(iKczlService.getLdjscData(nd));
    }

    /**
     * 驾驶舱首页-基本情况
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-基本情况")
    @GetMapping("/getLdjscDataJbqk")
    public CommonResult<LdjscDataJbqk> getLdjscDataJbqk(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataJbqk(nd));
    }

    /**
     * 驾驶舱首页-热点矿产
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-热点矿产")
    @GetMapping("/getLdjscDataRdkc")
    public CommonResult<List<Xxlb>> getLdjscDataRdkc(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataRdkc(nd));
    }

    /**
     * 驾驶舱首页-矿产种类统计、战略性矿产种类统计
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-矿产种类统计、战略性矿产种类统计")
    @GetMapping("/getLdjscDataKczl")
    public CommonResult<LdjscDataKczl> getLdjscDataKczl(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataKczl(nd));
    }

    /**
     * 驾驶舱首页-矿业权
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-矿业权")
    @GetMapping("/getLdjscDataKyq")
    public CommonResult<List<Kyq>> getLdjscDataKyq(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataKyq(nd));
    }

    /**
     * 驾驶舱首页-矿产地规模
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-矿产地规模")
    @GetMapping("/getLdjscDataKcdgm")
    public CommonResult<Kcdgmtj> getLdjscDataKcdgm(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataKcdgm(nd));
    }

    /**
     * 驾驶舱首页-主要优势矿产
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-主要优势矿产")
    @GetMapping("/getLdjscDataZyyskc")
    public CommonResult<List<Zyyskc>> getLdjscDataZyyskc(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataZyyskc(nd));
    }

    /**
     * 驾驶舱首页-矿产分布
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-矿产分布")
    @GetMapping("/getLdjscDataKcfb")
    public CommonResult<List<Kcfb>> getLdjscDataKcfb(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataKcfb(nd));
    }
    /**
     * 驾驶舱首页-矿种分布
     *
     * @param nd
     * @author sqq
     * @since 2024/9/10 9:46
     */
    @ApiOperation("驾驶舱首页-矿种分布")
    @GetMapping("/getLdjscDataKzfb")
    public CommonResult<List<Kcfb>> getLdjscDataKzfb(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataKzfb(nd));
    }

    /**
     * 驾驶舱首页-矿产利用率
     *
     * @param nd
     * @author Kevin
     * @since 2024/7/19 9:46
     */
    @ApiOperation("驾驶舱首页-矿产利用率")
    @GetMapping("/getLdjscDataKclyl")
    public CommonResult<Kclyl> getLdjscDataKclyl(Integer nd) {
        return CommonResult.data(iKczlService.getLdjscDataKclyl(nd));
    }
}